#ifndef ZS_MISSION_MGR_H
#define ZS_MISSION_MGR_H

#include <nel/misc/singleton.h>
#include <game_share/game_def.h>
#include <set>

namespace ZS
{
class CPlayer;
class CMissionMgr : public NLMISC::CSingleton<CMissionMgr>
{
public:

	bool init();

	bool mission_accept( DEF::MISSION_ID mission_id, CPlayer* pPlayer );

	bool mission_complete( DEF::MISSION_ID mission_id,  DEF::UID uid );

	bool on_event( DEF::EVENT_ID mission_event, CPlayer* player );

	bool register_event( DEF::EVENT_ID mission_event, DEF::MISSION_ID mission_id );

	bool register_mission( DEF::MISSION_ID mission_id );

private:

	bool settlement( DEF::MISSION_ID mission_id, CPlayer* pPlayer );

	std::string get_lua_table( DEF::MISSION_ID mission_id );

	enum	{ MISSION_EVENT_MAX = 0xffff };

	typedef std::set<DEF::MISSION_ID>   TMissionReg;
	TMissionReg	m_MissionReg;

	typedef std::set<DEF::MISSION_ID>               TEventMission;
	typedef std::vector<TEventMission>              TEventReg;	//	TEventReg[MISSION_EVENT][MISSION_ID]
	TEventReg   m_EventReg;
};

#define  MissionMgr  CMissionMgr::instance()

}
#endif		//	ZS_MISSION_MGR_H









